/**
 * Alibaba.com.cn Inc.
 * Copyright (c) 2004-2021 All Rights Reserved.
 */
package com.starlink.common.enums;

import java.util.Arrays;

/**
 * @author zhanghong
 * @version OrderTypeEnum.java, v 0.1 2024/4/11 22:26 下午 OrderTypeEnum Exp $$
 */
public enum OrderRefundEnum {
    ALL_REFUND(0, "全部退款"),
    PART_REFUND(1, "部分退款"),
    SHEN_PI(0, "待审批"),
    JI_HUI(1, "待寄回"),
    YUN_SHU(2, "换货运输中"),
    WAN_CHENG(3, "已完成"),
    BO_HUI(4, "已驳回");

    private Integer type;
    private String desc;

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    OrderRefundEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static OrderRefundEnum getByType(Integer type) {
        if (type == null) {
            return null;
        }
        return Arrays.stream(values()).filter(item -> type.equals(item.getType())).findFirst().orElse(null);
    }
}
